<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+
					request.getServerName()+":"+
					request.getServerPort()+path+"/";
//	out.print(basePath);
%>
<base href="<%=basePath %>">
<div class="modal-over">
  <div class="modal-center animated fadeInUp text-center" style="width:200px;margin:-80px 0 0 -100px;">
    <div class="thumb-md">

	<c:if test="${!empty user}">
		<img src="${ sessionScope.user.user_headImg }" class="img-circle b-a b-light b-3x">
	</c:if> <c:if test="${empty user}">
		<img src="images/a0.png" class="img-circle b-a b-light b-3x">
	</c:if>
    
    
    </div>
    <p class="text-white h4 m-t m-b"> <c:if test="${!empty user}">
              	${ sessionScope.user.user_name }
              </c:if> <c:if test="${empty user}">
              	游客
              </c:if> </p>
    <div class="input-group">
      <input id="password" type="password" class="form-control text-sm btn-rounded" placeholder="Enter pwd to continue">
      <span class="input-group-btn">
        <button id="validatePwd" class="btn btn-success btn-rounded" type="button" data-dismiss="modal"><i class="fa fa-arrow-right"></i></button>
      </span>
    </div>
  </div>
</div>

<script>
	$(function(){
		$("#validatePwd").click(function() {
			var inputPwd = $("#password").val();
			var sessionPwd = ${ sessionScope.user.user_password };
			alert(inputPwd+" "+sessionPwd);
			if(inputPwd==sessionPwd){
				$.ajax({
					url : "userServlet",
					type : "get",
					data : "type=logout",
					success : function(data){ 
						alert("您已下线.....");
						window.location.href="index.jsp";
					}
				});
			}else{
				alert("密码错误");
			}
		});
	});
</script>